package Job03;

import java.util.Scanner;

public class mq {
    public String name;
    public int age01;

    public void age(){
        Scanner input = new Scanner(System.in);
        while (true){
            System.out.print("请输入姓名:");
            name = input.next();
            if (name.equals("n")){
                System.out.println("程序退出");
                break;
            }
            System.out.print("请输入年龄:");
            age01 = input.nextInt();
            if (age01 <= 60 && age01 >= 18){
                System.out.println("姓名:" +name+ ",年龄:" +age01+ ",20元");
            }
            if (age01 > 60 || age01 < 18){
                System.out.println("姓名:" +name+ ",年龄:" +age01+ ",免费");
            }
        }

    }

}
